package com.infore.siteManagement.entity.otherEntity;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.infore.siteManagement.entity.Station;


/**
 * The persistent class for the CUSTOMTREE database table.
 * LLF
 * 自定义查询站点类
 */
@Entity
@Table(name = "CUSTOMTREE")
@NamedQuery(name="Customtree.findAll", query="SELECT c FROM Customtree c")
public class Customtree implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="CUSTOMTREE_ID")
	@GeneratedValue(generator = "uuidGenerator")
	@GenericGenerator(name = "uuidGenerator", strategy = "uuid") // UUID生成策略
	private String customtreeId;

	/**分组名**/
	@Column(name="CUSTOMTREE_GROUPNAME")
	private String customtreeGroupname;

	/**当前用户名或者id**/
	@Column(name="CUSTOMTREE_USERID")
	private String customtreeUserid;
	
	/**站点与customtreeId多对多 用户名和组名做主键**/
	@JsonIgnoreProperties
	@ManyToMany(targetEntity = Station.class)
	@JoinTable(name = "CUSTOM_AND_STATION", joinColumns = @JoinColumn(name = "CUSTOMTREE_ID"), 
	inverseJoinColumns = @JoinColumn(name = "STATION_ID")) 
	private Set<Station> stations;

	public Customtree() {
	}

	public String getCustomtreeId() {
		return this.customtreeId;
	}

	public void setCustomtreeId(String customtreeId) {
		this.customtreeId = customtreeId;
	}

	public String getCustomtreeGroupname() {
		return this.customtreeGroupname;
	}

	public void setCustomtreeGroupname(String customtreeGroupname) {
		this.customtreeGroupname = customtreeGroupname;
	}

	public String getCustomtreeUserid() {
		return this.customtreeUserid;
	}

	public void setCustomtreeUserid(String customtreeUserid) {
		this.customtreeUserid = customtreeUserid;
	}

	public Set<Station> getStations() {
		return stations;
	}

	public void setStations(Set<Station> stations) {
		this.stations = stations;
	}

}